package com.neuedu.page_objects;

import com.neuedu.bases.BasePage;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;

public class MaintenancePage extends BasePage{


    public MaintenancePage(ChromeDriver driver){super(driver);}


    public void Login()
    {
        waitSleep(1);
        findElement(By.cssSelector("[placeholder=username]")).sendKeys("112233");
        findElement(By.cssSelector("[placeholder=password]")).sendKeys("112233");
        waitSleep(1);
        findElement(By.className("login-btn")).click();
    }

    public String getButtonId(String id){
        return findElement(By.id(id)).getText();
    }

    public void clickButton(String id){
        findElement(By.id(id)).click();
    }

    public String getMessage(){
        return findElement(By.cssSelector("p[class='el-message__content']")).getText();
    }

    public String getIssues(int index){
        return findElements(By.className("cell")).get(index).getText();
    }

    public void inputReason(String info){
        findElement(By.className("el-textarea__inner")).sendKeys(info);
    }

    public void goOtherPage(int index){
        findElements(By.className("el-menu-item")).get(index).click();
    }

}
